package com.onedec.designer.service.impl;

import com.onedec.designer.entity.OnedecProject;
import com.onedec.designer.entity.OnedecProjectExample;
import com.onedec.designer.mapper.OnedecProjectMapper;
import com.onedec.designer.service.OnedecProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OnedecProjectServiceImpl implements OnedecProjectService {
    @Autowired
    private OnedecProjectMapper onedecProjectMapper;

    @Override
    public OnedecProject selectByProjectNull(String url) {
        OnedecProjectExample onedecProjectExample = new OnedecProjectExample();
        OnedecProjectExample.Criteria or = onedecProjectExample.or();
        or.andProjectNullEqualTo(url);
        List<OnedecProject> onedecProjects = onedecProjectMapper.selectByExample(onedecProjectExample);
    if(onedecProjects.size()!=0){
        return onedecProjects.get(0);
    }
    return null;
    }
}
